<template>
    <div id="OrdersCarrier">
        <v-details :detailData="inputData" :inputConfig="inputConfig" @pop="setdata"></v-details>
    </div>
</template>

<script>
    import details from "commons/Detail";
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        name: "OrdersCarrier",
        mixins: [baseMixin],
        props: {
            inputData: {
                type: Object
            }
        },
        data() {
            return {
                inputConfig: [
                    [
                        {
                            type: "input",
                            label: this.$t('out.orderkey'),
                            props: "orderkey",
                            disabled: true
                        },
                        {
                            type: "table",
                            label: this.$t('bill.carrierCode'),
                            props: "carriercode",
                            tableConfig: [
                                {
                                    label: this.$t('config.shipper'),
                                    prop: "storerkey",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.company'),
                                    prop: "company",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.city'),
                                    prop: "city",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.provice'),
                                    prop: "state",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.postcode'),
                                    prop: "zip",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.contact'),
                                    prop: "contact",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.phone'),
                                    prop: "phone",
                                    input: "input",
                                },
                            ],
                            url: `queryStorer/3/?/${this.$store.state.wms}`
                        },
                        {
                            type: "date",
                            label: this.$t('in.arrivaldatetime'),
                            props: "actualarrivaldate",
                            disabled: true
                        },
                        {
                            type: "date",
                            label: this.$t('in.actualdeparturedate'),
                            props: "depdatetime"
                        },
                        {
                            type: "date",
                            label: this.$t('out.actualdelvdate'),
                            props: "actualdelvdate"
                        },
                        {
                            type: "date",
                            label: this.$t('out.planneddelvdate'),
                            props: "planneddelvdate"
                        },
                        {
                            type: "date",
                            label: this.$t('out.scheduleddelvdate'),
                            props: "scheduleddelvdate"
                        },

                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('in.carriername'),
                            props: "carriername",
                            disabled: true
                        },
                        {
                            type: "input",
                            label: this.$t('out.carrieraddress',{no:1}),
                            props: "carrieraddress1",
                            disabled: true
                        },
                        {
                            type: "input",
                            label: this.$t('out.carrieraddress',{no:2}),
                            props: "carrieraddress2",
                            disabled: true
                        },
                        {
                            type: "input",
                            label: this.$t('config.phone'),
                            props: "carrierphone",
                            disabled: true
                        },
                        {
                            type: "input",
                            label: this.$t('config.city'),
                            props: "carriercity",
                            disabled: true
                        },
                        {
                            type: "input",
                            label: this.$t('config.provice'),
                            props: "carrierstate",
                            disabled: true
                        },
                        {
                            type: "input",
                            label: this.$t('config.postcode'),
                            props: "carrierzip",
                            disabled: true
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('bill.country'),
                            props: "carriercountry"
                        },
                        {
                            type: "input",
                            label: this.$t('in.trailernumber'),
                            props: "trailernumber"
                        },
                        {
                            type: "input",
                            label: this.$t('in.trailerdesc'),
                            props: "trailerdescription"
                        },
                        {
                            type: "input",
                            label: this.$t('in.trailerowner'),
                            props: "trailerowner"
                        },
                        {
                            type: "input",
                            label: this.$t('in.drivername'),
                            props: "drivername"
                        },
                        {
                            type: "input",
                            label: this.$t('out.pronumber'),
                            props: "pronumber"
                        },
                        {
                            type: "input",
                            label: this.$t('out.rtxexpresskey'),
                            props: "rtxexpresskey"
                        },
                    ],
                ]
            };
        },
        methods: {
            async setdata(data, id, close) {
                this.inputData.carriercode = data.storerkey;
            }
        },
        mounted() {
        },
        components: {
            "v-details": details
        }
    };
</script>

<style scoped>
</style>

